package com.huishu.tcm.service.serviceImpl;

import com.huishu.tcm.entity.Annex1;
import com.huishu.tcm.mapper.Annex1Mapper;
import org.springframework.stereotype.Service;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huishu.tcm.service.Annex1Service;

@Service
public class Annex1ServiceImpl extends ServiceImpl<Annex1Mapper, Annex1> implements Annex1Service {

	 /**
     * 筛选条件
     * @param v
     * @return
     */
    @Override
    public QueryWrapper<Annex1> getQueryWrapper(Annex1 v){
        QueryWrapper<Annex1> queryWrapper = new QueryWrapper<>();
        if(ObjectUtil.isEmpty(v)){
            return queryWrapper;
        }
		if(ObjectUtil.isNotEmpty(v.getId())){
        	queryWrapper.eq("id", v.getId());
        }
		// 患者id
		if(ObjectUtil.isNotEmpty(v.getPatientId())){
		    queryWrapper.eq("patient_id", v.getPatientId());
        }
		// 第几次录入
        if(ObjectUtil.isNotEmpty(v.getNumber())){
            queryWrapper.eq("number", v.getNumber());
        }
       	return queryWrapper;
    }
}